refactor: modularize monolithic gitHappens.py (#116)#159
Open
Tarunswamy-Muralidharan wants to merge 1 commit into
Open
refactor: modularize monolithic gitHappens.py (#116)#159Tarunswamy-Muralidharan wants to merge 1 commit into
Tarunswamy-Muralidharan wants to merge 1 commit into
Conversation
Split the 844-line gitHappens.py into focused modules per the architecture proposed in zigcBenx#116. All existing functionality is preserved and the original entry point remains a thin backward-compatible wrapper. ### New structure - main.py - CLI argument parsing and command dispatch - config.py - Configuration loading from configs/config.ini - templates.py - Template and reviewer loading from configs/templates.json - gitlab_api.py - GitLab API interactions and MR lookups - git_utils.py - Git operations (remotes, branches, commits) - interactive.py - User prompts and selection flows via inquirer - commands/create_issue.py - Issue creation workflow - commands/open_mr.py - Open MR in browser - commands/review.py - Reviewer assignment and time tracking - commands/deploy.py - Deployment checks and incident reporting - commands/summary.py - AI-powered commit summary generation ### Quality improvements - Added unit tests for all modules (14 tests, all passing) - Added GitHub Actions CI workflow testing Python 3.10-3.13 - Added requirements-dev.txt for test dependencies - Updated README with project structure documentation ### Verification - python3 -m unittest discover -s tests -v (14 tests pass) - python3 -m py_compile gitHappens.py main.py config.py ... (all modules compile) - python3 gitHappens.py --help (backward compatibility maintained)
Author
|
Hi @zigcBenx — I know there are many refactor PRs already, so I focused on quality infrastructure rather than just splitting files: What makes this different
StructureHappy to address any feedback. Thanks for maintaining this tool! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #116
Splits the 844-line monolithic
gitHappens.pyinto focused modules with clear separation of concerns, exactly as proposed in the issue.What makes this different
While earlier PRs focused on splitting code into files, this refactor adds quality infrastructure that makes the codebase maintainable:
Architecture (matches proposed structure)
main.py— CLI entry point and argument parsingconfig.py— Configuration managementtemplates.py— Template processinggitlab_api.py— GitLab API interactionsgit_utils.py— Git operationsinteractive.py— User prompts and CLI interactionscommands/create_issue.py— Issue creation logiccommands/open_mr.py— Merge request operationscommands/review.py— Review workflowcommands/deploy.py— Deployment checkscommands/summary.py— Commit summary generationQuality additions
py_compilegitHappens.pyremains a thin wrapper so existing aliases keep workingVerification
python3 -m py_compile *.py commands/*.pypython3 -m unittest discover -s tests -vpython3 gitHappens.py --helpAcceptance criteria
gitlab_api.pyconfig.pytemplates.pycommands/folder